/*
 * Created on 2005-4-14
 *
 */
package com.hd123.rumba.domain;

import java.util.HashMap;

import com.hd123.rumba.runtime.Manager;

/**
 * @author caili
 */
public class StateMgr extends Manager {
  
  private static StateMgr instance = null;
  
  public static StateMgr getInstance() {
    if (instance == null) instance = new StateMgr();
    return instance;
  }
  
  private StateMgr() {
    super();
  }

  public static String CAPTION_UNKNOWN = "未知";

  public static String getCaption(HashMap statesMap, Object state) {
    String caption = CAPTION_UNKNOWN;
    if (statesMap != null && state != null) {
      caption = (String) statesMap.get(state);
      if (caption == null)
        caption = CAPTION_UNKNOWN;
    }
    return caption;
  }
}
